﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BoxBinary.AspectCache.Core.PolicyDefinition;

namespace BoxBinary.AspectCache.Samples.WebForms
{
    public partial class HttpRuntimeCacheIterator : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var items = HttpRuntime.Cache.OfType<DictionaryEntry>().ToList();

            foreach (var cacheItemPolicy in items)
            {
                Response.Write(cacheItemPolicy.Key + @"\n<br/>");
            }


            var items2 = HttpRuntime.Cache.OfType<IPolicyBoundCachePackage>().ToList();

            foreach (var cacheItemPolicy in items2)
            {
                Response.Write(cacheItemPolicy.Key + @"\n<br/>");
            }
        }
    }
}